import './assets/main.css'
import 'element-plus/dist/index.css'
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import { useThemeStore } from './stores/modules/theme'

// 创建应用实例
const app = createApp(App)
const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)

// 使用插件
app.use(ElementPlus, {
  locale: zhCn,  // 使用中文
})
app.use(router)
app.use(pinia)

// 初始化主题
const themeStore = useThemeStore(pinia)
themeStore.initTheme()

// 挂载应用
app.mount('#app')
